package com.yunpeng.aidevice.dao.mapper.record;


import com.yunpeng.aidevice.dao.mapper.IRecordMapper;
import com.yunpeng.aidevice.dao.model.record.NoticeRuleParameterDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 设备通知规则参数值 Mapper 接口
 * </p>
 *
 * @author hemw
 * @since 2020-04-26
 */
@Mapper
public interface NoticeRuleParameterMapper extends IRecordMapper<NoticeRuleParameterDO> {

    /**
     * 获取设备的规则参数配置
     *
     * @param deviceCode 设备代码
     * @param ruleCodes  规则代码
     * @return
     */
    List<NoticeRuleParameterDO> getByDeviceRuleCodes(@Param("deviceCode") String deviceCode, @Param("ruleCodes") List<String> ruleCodes);


    /**
     * 批量新增
     *
     * @param noticeRuleParameterDOList
     */
    void batchAdd(@Param("dos") List<NoticeRuleParameterDO> noticeRuleParameterDOList);

    /**
     * 删除设备规则参数配置
     *
     * @param deviceCode 设备代码
     * @param ruleCodes  规则代码集合
     */
    void deleteDeviceRuleParameter(@Param("deviceCode") String deviceCode, @Param("ruleCodes") List<String> ruleCodes);

    /**
     * 获取指定的设备提醒规则参数值
     *
     * @param deviceCode
     * @param ruleCode
     * @param parameterName
     * @return
     */
    NoticeRuleParameterDO getByDeviceParameter(@Param("deviceCode") String deviceCode, @Param("ruleCode") String ruleCode, @Param("parameterName") String parameterName);
}
